{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2000, 137)\n",
      "0 0 610000000041 610000000041\n",
      "1 1 -88323624281 -88323624282\n",
      "2 0 88323624281 88323624281\n",
      "3 -1 248028272159 248028272160\n",
      "4 2 85760720886 85760720884\n",
      "5 0 171506262991 171506262991\n",
      "6 0 -189554621844 -189554621844\n",
      "7 -1 269179798970 269179798971\n",
      "8 2 251028506776 251028506774\n",
      "9 1 -171506262991 -171506262992\n"
     ]
    }
   ],
   "source": [
    "#尝试利用原侧方程组纠对偶错\n",
    "#尝试模小整数\n",
    "from sage.modules.free_module_integer import IntegerLattice\n",
    "import sys\n",
    "import numpy as np\n",
    "ALL1=np.loadtxt('big-aka48-2025diu-roundfullcoes-primal-dual-ALL1.txt',dtype=np.int64)\n",
    "xxx=[0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n",
    "le=len(xxx) \n",
    "print(np.shape(ALL1))\n",
    "#测试前10个方程\n",
    "for ii in range(10):\n",
    "    #方程左边\n",
    "    eq1=sum(ALL1[ii,j]*xxx[j] for j in range(le))\n",
    "    #方程右边（含错值）\n",
    "    eq2=ALL1[ii,le]\n",
    "    print(ii,eq1-eq2,eq1,eq2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "SageMath 9.3",
   "language": "sage",
   "name": "sagemath"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
